package com.example.ruleenginelearning.example.rules;

import com.example.ruleenginelearning.example.engine.OrderRule;
import com.example.ruleenginelearning.example.model.Order;

public class ShippedOrderRule implements OrderRule {

    @Override
    public boolean evaluate(Order order) {
        return "SHIPPED".equals(order.getStatus());
    }

    @Override
    public void execute(Order order) {
        System.out.println("已发货订单: " + order.getId() +
                " | 等待确认收货");
        order.setStatus("DELIVERED");
    }
}
